<template>
  <div style="height:100%;width:100%;position:relative;">
    <div class="pagetop">
      <div style="width:100%">
        <div style="width:100%;float:left">
          <table style="font-size:12px;" class="table1style">
            <tr>
              <td>快速检索</td>
              <td>
                <el-input v-model.trim="txtsearch" placeholder="仪器ID|代号|名称|型号" @keyup.enter.native="findList2" clearable
                  style="width:160px"></el-input>
              </td>
              <td>检验组</td>
              <td>
                <rm-ddl-common :appendtobody="true" @change="labgroupchange" datatype="labgroup" dataname="检验工作组"
                  v-model="labgroupval" width="150px"></rm-ddl-common>
              </td>
              <td>仪器大类</td>
              <td>
                <rm-ddl-common @change="seccodechange" datatype="seccode" kindno="INSTTYPE" dataname="系统代码(仪器大类)"
                  :appendtobody="true" :value="seccodeval" width="190px">
                </rm-ddl-common>
              </td>
              <td>模块</td>
              <td>
                <el-select v-model="childinstr" placeholder="请选择" @change="findList2" style="width:100px">
                  <el-option key="" label="全部模块" value=""></el-option>
                  <el-option key="0" label="父模块" value="0"></el-option>
                  <el-option key="1" label="子模块" value="1"></el-option>
                </el-select>
              </td>
            </tr>
          </table>
        </div>
        <div style="width:100%;float:left;">
          <table style="float:right">
            <tr>
              <td>
                <el-button icon="el-icon-search" type="primary" @click="findList2" v-has="'PINQUERY'">查询</el-button>
              </td>
              <td>
                <el-button icon="el-icon-edit" @click="modifyList" v-has="'PMODIFY'">修改</el-button>
              </td>
              <td>
                <el-button icon="el-icon-delete-solid" @click="removeList" v-has="'PDELETE'"
                  :disabled="disdelflag">删除</el-button>
              </td>

              <td>
                <el-button icon="el-icon-upload2" @click="ExportCsv" v-has="'PEXPORT'">导出</el-button>
              </td>
              <!-- <td>
                          <el-button  icon="el-icon-printer" @click="printrecord">打印</el-button>
                      </td> -->
              <td>
                <el-button icon="el-icon-setting" @click="instorerules">入库规则</el-button>
              </td>
              <td>
                <el-button icon="el-icon-s-check" @click="instrRegister">仪器注册</el-button>
              </td>
              <td>
                <el-button icon="el-icon-menu" @click="refqccode">二维码注册</el-button>
              </td>
            </tr>
          </table>
        </div>
      </div>
    </div>
    <div class="pagecenter">
      <div class="middle-center">
        <template>
          <vxe-grid :columns="tableColumn" :keyboard-local-config="keyConfig" :pager-config="tablePage"
            :proxy-config="tableProxy" :row-class-name="rowClassName" header-align="center"
            :cell-class-name="cellClassName" :select-config="selectConfig" border height="auto" highlight-current-row
            highlight-hover-row ref="xTable" resizable show-header-overflow="tooltip" show-overflow="tooltip" size="mini"
            @current-change="currentChangeEvent" :sort-config="{trigger: 'cell'}"></vxe-grid>
        </template>
      </div>
      <div class="middle-right">
        <el-tabs v-model="activeName" type="card" @tab-click="handleClick">
          <el-tab-pane label="仪器信息" name="instridname">
            <el-form label-width="auto" :model="TestInstruments" @submit.native.prevent>
              <table class="formtablestyle">
                <tr>
                  <td>所属检验组</td>
                  <td>
                    <el-input v-model="TestInstruments.labgroupname" placeholder="" readonly></el-input>
                  </td>
                  <td>仪器ID</td>
                  <td>
                    <el-input v-model="TestInstruments.instrid" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>仪器代号</td>
                  <td>
                    <el-input v-model="TestInstruments.instrno" placeholder="" readonly></el-input>
                  </td>
                  <td>仪器名称</td>
                  <td>
                    <el-input v-model="TestInstruments.instrname" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>仪器型号</td>
                  <td>
                    <el-input v-model="TestInstruments.instrserial" placeholder="" readonly></el-input>
                  </td>
                  <td>仪器大类</td>
                  <td>
                    <el-input v-model="TestInstruments.instrclass" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>对应报告单元</td>
                  <td>
                    <el-input v-model="TestInstruments.rptunitname" placeholder="" readonly></el-input>
                  </td>
                  <td>子模块</td>
                  <td>
                    <el-input v-model="TestInstruments.childinstr" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>模块代号</td>
                  <td>
                    <el-input v-model="TestInstruments.childno" placeholder="" readonly></el-input>
                  </td>
                  <td>模块所属仪器</td>
                  <td>
                    <el-input v-model="TestInstruments.parentname" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>仪器简称</td>
                  <td>
                    <el-input v-model="TestInstruments.instrna" placeholder="" readonly></el-input>
                  </td>
                  <td>双工模式</td>
                  <td>
                    <el-input v-model="TestInstruments.dualmode" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>计算机MAC地址</td>
                  <td>
                    <el-input v-model="TestInstruments.macaddress" placeholder="" readonly></el-input>
                  </td>
                  <td>安装计算机名称</td>
                  <td>
                    <el-input v-model="TestInstruments.compute_name" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>安装时间</td>
                  <td>
                    <el-input v-model="TestInstruments.install_dt" placeholder="" readonly></el-input>
                  </td>
                  <td>重装时间</td>
                  <td>
                    <el-input v-model="TestInstruments.reinstall_dt" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>计算机IP</td>
                  <td>
                    <el-input v-model="TestInstruments.compute_ip" placeholder="" readonly></el-input>
                  </td>
                  <td>安装位置</td>
                  <td>
                    <el-input v-model="TestInstruments.install_place" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>仪器用途</td>
                  <td>
                    <el-input v-model="TestInstruments.inst_useage" placeholder="" readonly></el-input>
                  </td>
                  <td>注册时间</td>
                  <td>
                    <el-input v-model="TestInstruments.register_dt" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>在用</td>
                  <td>
                    <div v-if="TestInstruments.inuse == 1">
                      <el-input value="在用" class="REFinuse2"></el-input>
                    </div>
                    <div v-else>
                      <el-input value="停用" class="REFinuse1"></el-input>
                    </div>
                  </td>
                  <td>停用时间</td>
                  <td>
                    <el-input v-model="TestInstruments.stop_dt" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>HIS代码</td>
                  <td>
                    <el-input v-model="TestInstruments.his_code" placeholder="" readonly></el-input>
                  </td>
                  <td>运行时间</td>
                  <td>
                    <el-input v-model="TestInstruments.open_time" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>退出时间</td>
                  <td>
                    <el-input v-model="TestInstruments.close_time" placeholder="" readonly></el-input>
                  </td>
                  <td>运行ID</td>
                  <td>
                    <el-input v-model="TestInstruments.runid" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>运行电脑</td>
                  <td>
                    <el-input v-model="TestInstruments.runcomputer" placeholder="" readonly></el-input>
                  </td>
                  <td>运行电脑 IP</td>
                  <td>
                    <el-input v-model="TestInstruments.runip" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>保留1</td>
                  <td>
                    <el-input v-model="TestInstruments.reserve1" placeholder="" readonly></el-input>
                  </td>
                  <td>保留2</td>
                  <td>
                    <el-input v-model="TestInstruments.reserve2" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>保留3</td>
                  <td>
                    <el-input v-model="TestInstruments.reserve3" placeholder="" readonly></el-input>
                  </td>
                  <td>保留4</td>
                  <td>
                    <el-input v-model="TestInstruments.reserve4" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>保留5</td>
                  <td>
                    <el-input v-model="TestInstruments.reserve5" placeholder="" readonly></el-input>
                  </td>
                  <td>通讯版本</td>
                  <td>
                    <el-input v-model="TestInstruments.onlineversion" placeholder="" readonly></el-input>
                  </td>
                </tr>
                <tr>
                  <td>解码版本</td>
                  <td>
                    <el-input v-model="TestInstruments.decversion" placeholder="" readonly></el-input>
                  </td>
                </tr>
              </table>
            </el-form>
          </el-tab-pane>
          <!-- v-if="bHaveChild" -->
          <el-tab-pane label="临时子模块" name="childinstrname" v-if="bHaveChild">
            <div style="height:25px;width:100%;background-color: #0095d9;">
              <span
                style="float:bottom;padding-left:5px;font-size:13px;color: white;font-weight:600;">当前仪器存在临时子模块,安装后加入仪器设备表单。</span>
              <!-- <el-button type="primary" style="float:right" @click="ToChild">确定安装</el-button> -->
            </div>
            <div class="childtbtopcss">
              <vxe-table show-overflow ref="tpCXTable" :data.sync="tpChildData" class="mytable-style" height="auto"
                :sort-config="{trigger: 'cell'}" border size="mini" show-header-overflow highlight-current-row resizable
                stripe header-align="center" @current-change="TpChildChange" :key="tempkey">
                <vxe-table-column align="center" type="index" width="40" title="No."></vxe-table-column>
                <vxe-table-column field="parentname" title="父仪器" width="180"></vxe-table-column>
                <!-- <vxe-table-column field="parentid" title="父仪器ID" width="80"></vxe-table-column> -->
                <vxe-table-column field="childno" title="模块代号" width="120"></vxe-table-column>
                <vxe-table-column align="center" field="instrserial" title="子模块型号" width="120"></vxe-table-column>
                <vxe-table-column align="center" field="create_dt" title="生成时间" width="120">
                </vxe-table-column>
                <template v-slot:fix>
                  <div style="font-size:17px;padding:3px;background-color:#fff;text-align:center;font-weight:bold">
                    <el-button @click="ToChild()" class="el-button--310">安装子模块</el-button>
                    <el-button @click="btnDeleteTemp()" class="el-button--310">删除子模块</el-button>
                  </div>
                </template>
              </vxe-table>
            </div>
            <!-- <div style="height:30px;width:100%;color:#6a6f77;text-align: center">
                      </div> -->
            <!-- <div style="height:20px;width:100%;background-color: #0095d9;">
                          <span style="font-size:14px;color: white;font-weight:600;">子模块</span>
                      </div>
                      <div class="childtbbotcss">
                      </div> -->
          </el-tab-pane>
        </el-tabs>
      </div>
    </div>
    <el-dialog :title="dialogtitle" :close-on-click-modal="false" v-el-drag-dialog :visible.sync="dialogVisible"
      :width="dialogwidth" :destroy-on-close="true">
      <el-form label-width="auto" ref="popTestInstruments" :model="popTestInstruments" @submit.native.prevent>
        <table class="formtablestyle">
          <tr>
            <td>所属检验组</td>
            <td>
              <rm-ddl-common :appendtobody="true" @change="poplabgroupchange" datatype="labgroup" dataname="检验工作组"
                width="100%" v-model="popTestInstruments.labgroupid" style="text-align:center" ref="autofocus1"
                @keyup.enter.native="Funautofocus('autofocus1')"></rm-ddl-common>
            </td>
            <td>仪器代号</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.instrno" placeholder="" ref="autofocus2"
                @keyup.enter.native="Funautofocus('autofocus2')"></el-input>
            </td>
          </tr>
          <tr>
            <td>仪器名称</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.instrname" placeholder="" ref="autofocus3"
                @keyup.enter.native="Funautofocus('autofocus3')"></el-input>
            </td>
            <td>对应报告单元</td>
            <td>
              <rm-ddl-rptunit prgno="LIS140" :appendtobody="true" @change="poprptunitchange"
                v-model="popTestInstruments.rptunitid" width="100%" ref="autofocus4"
                @keyup.enter.native="Funautofocus('autofocus4')"></rm-ddl-rptunit>
            </td>
          </tr>
          <tr>
            <td>仪器简称</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.instrna" placeholder="" ref="autofocus5"
                @keyup.enter.native="Funautofocus('autofocus5')"></el-input>
            </td>
            <td>安装位置</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.install_place" placeholder="" ref="autofocus6"
                @keyup.enter.native="Funautofocus('autofocus6')"></el-input>
            </td>
          </tr>
          <tr>
            <td>仪器用途</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.inst_useage" placeholder="" ref="autofocus7"
                @keyup.enter.native="Funautofocus('autofocus7')"></el-input>
            </td>
            <td>HIS代码</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.his_code" placeholder="" ref="autofocus8"
                @keyup.enter.native="Funautofocus('autofocus8')"></el-input>
            </td>
          </tr>
          <tr>
            <td>保留1</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.reserve1" placeholder="" ref="autofocus9"
                @keyup.enter.native="Funautofocus('autofocus9')"></el-input>
            </td>
            <td>保留2</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.reserve2" placeholder="" ref="autofocus10"
                @keyup.enter.native="Funautofocus('autofocus10')"></el-input>
            </td>
          </tr>
          <tr>
            <td>保留3</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.reserve3" placeholder="" ref="autofocus11"
                @keyup.enter.native="Funautofocus('autofocus11')"></el-input>
            </td>
            <td>保留4</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.reserve4" placeholder="" ref="autofocus12"
                @keyup.enter.native="Funautofocus('autofocus12')"></el-input>
            </td>
          </tr>
          <tr>
            <td>保留5</td>
            <td>
              <el-input type="text" v-model="popTestInstruments.reserve5" placeholder="" ref="autofocus13"
                @keyup.enter.native="Funautofocus('autofocus13')"></el-input>
            </td>
            <td>在用</td>
            <td>
              <el-checkbox true-label="1" false-label="0" v-model="popTestInstruments.inuse" ref="autofocus14"
                @keyup.enter.native="Funautofocus('autofocus14')"></el-checkbox>
            </td>
          </tr>
        </table>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button @click="SubmitMod">确 定</el-button>
        <el-button @click="dialogVisible = false" :autofocus="true">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog :title="dialogtitle" :close-on-click-modal="false" v-el-drag-dialog :visible.sync="DeldialogVisible"
      :width="dialogwidth" :destroy-on-close="true">
      <span class="el-icon-info">确定删除检验仪器名称为<b style="color:red">{{ message }}</b>的记录吗？</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click.native="SubmitDel" class="mt-3" size="small">确 定</el-button>
        <el-button @click="DeldialogVisible = false" :autofocus="true">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog :title="dialogtitle" :close-on-click-modal="false" v-el-drag-dialog :visible.sync="bToChildDlg"
      :width="dialogwidth" :destroy-on-close="true">
      <span class="el-icon-info">您确定将临时子模块：[<b style="color:red">{{ childmessage }}</b>]安装吗？</span>
      <span slot="footer" class="dialog-footer">
        <el-button @click.native="btnChildSave" class="mt-3" size="small">确 定</el-button>
        <el-button @click="bToChildDlg = false" :autofocus="true">取 消</el-button>
      </span>
    </el-dialog>
    <el-dialog title="仪器入库规则设定" v-el-drag-dialog :close-on-click-modal="false" :visible.sync="dialogInstoreVisible"
      width="75%">
      <div style="height:500px;width:100%;position:relative;">
        <div class="rulepagetop">
          <table class="table1style" style="width:100%">
            <tr>
              <td>起始样本号</td>
              <td>
                <el-input v-model="samplestrat" placeholder="" style="width:100px"></el-input>
              </td>
              <td>截至样本号</td>
              <td>
                <el-input v-model="sampleend" placeholder="" style="width:100px"></el-input>
              </td>
              <td>报告单元</td>
              <td>
                <rm-ddl-rptunit prgno="LIS140" :appendtobody="true" @change="rptunitchange" v-model="instorerptunit"
                  width="200px"></rm-ddl-rptunit>
              </td>
              <td align="right">
                <el-button @click.native="saveinstorerules">保 存 </el-button>
                <el-button @click.native="delinstorerules">删 除</el-button>
                <el-button @click="dialogInstoreVisible = false" :autofocus="true">取 消</el-button>
              </td>
            </tr>
          </table>
        </div>
        <div class="rulepagecenter">
          <div class="popmiddle-center">
            <vxe-table show-overflow ref="xTable1" height="auto" :loading="loading" :select-config="{reserve: true}"
              :edit-rules="validRules" :data.sync="tableData1" show-header-overflow highlight-current-row
              highlight-hover-row resizable size="mini" border
              :edit-config="{trigger: 'click', mode: 'cell', showStatus: true}" :mouse-config="{selected: true}"
              @current-change="popcurrentChangeEvent">
              <vxe-table-column type="index" title="NO." width="50"></vxe-table-column>
              <vxe-table-column field="interno" title="通道号" width="210" header-align="center"
                :edit-render="{name: 'select', options: channel_number}">
              </vxe-table-column>
              <vxe-table-column field="startsampleno" title="起始样本号" width="100" :edit-render="{name: 'input'}"
                align="center">
              </vxe-table-column>
              <vxe-table-column field="endsampleno" title="截至样本号" width="100" :edit-render="{name: 'input'}"
                align="center"></vxe-table-column>
              <vxe-table-column field="rptunitid" title="入库报告单元" width="160" sortable header-align="center" align="center"
                :edit-render="{name: 'select'}">
                <template v-slot="{row}">
                  <rm-ddl-rptunit prgno="LIS140" :appendtobody="true" v-model="row.rptunitid"></rm-ddl-rptunit>
                </template>
              </vxe-table-column>
            </vxe-table>
          </div>
          <div class="popmiddle-right">
            <vxe-table show-overflow ref="xTable2" height="auto" row-id="id" :loading="loading"
              :select-config="{reserve: true}" :data.sync="tableData2" show-header-overflow highlight-current-row
              highlight-hover-row resizable size="mini" border @cell-dblclick="poprightdblclick">
              <vxe-table-column type="index" title="NO." width="60"></vxe-table-column>
              <vxe-table-column field="interno" title="通道号" width="100" sortable header-align="center">
              </vxe-table-column>
              <vxe-table-column field="rpt_itemname" title="对应报告项目" width="160">
              </vxe-table-column>
            </vxe-table>
          </div>
        </div>
      </div>
    </el-dialog>

    <el-dialog title="二维码注册" :close-on-click-modal="false" v-el-drag-dialog :visible.sync="dialogQccodeVisible"
      width="950px" :destroy-on-close="true">
      <div style="height:400px;width:100%;position:relative;">
        <div class="popqcpagetop">
          <table class="formtablestyle">
            <tr>
              <td>产品</td>
              <td colspan="3">
                <el-radio-group v-model="qcproduct" @change="qcproductChange">
                  <el-radio :label="2">解码</el-radio>
                  <el-radio :label="3">双向</el-radio>
                </el-radio-group>
              </td>
            </tr>
            <tr>
              <td>单位名称</td>
              <td colspan="3">
                <el-input v-model="txtunitname" placeholder="" readonly></el-input>
              </td>
            </tr>
            <tr>
              <td>模块/仪器</td>
              <td>
                <el-input v-model="txtinstrserial" placeholder="" clearable readonly></el-input>
                <!-- <el-select v-model="txtinstrserial" placeholder="">
                                  <el-option v-for="item in modelinstrment" :key="item.value" :value="item.value" :label="item.label"></el-option>
                              </el-select> -->
              </td>
              <td>仪器ID</td>
              <td>
                <el-input v-model="txtinstrid" placeholder="" clearable readonly></el-input>
              </td>
            </tr>
          </table>
        </div>
        <div class="popqcpagecenter">
          <div class="popmiddle-center" style="border:1px solid #CCC;">
            <div id="qrcode" ref="qrcode" style="position:absolute;text-align:center;left:70px;top:35px"></div>
          </div>
          <div class="popmiddle-right" style="overflow:hidden;border:1px solid #CCC">
            <el-input type="textarea" v-model="creatcodestring" placeholder="" rows="16"></el-input>
          </div>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="creatqccode">生成二维码</el-button>
        <el-button @click="dialogQccodeVisible = false">取 消</el-button>
      </span>


    </el-dialog>

    <el-dialog title="检验仪器注册" :close-on-click-modal="false" v-el-drag-dialog :visible.sync="dialogInstrVisible"
      width="55%" :destroy-on-close="true">
      <div style="height:380px;width:100%;position:relative;">
        <div class="popinstrpagetop">
          <table class="formtablestyle">
            <tr>
              <td>产品</td>
              <td colspan="3">
                <el-radio-group v-model="product">
                  <el-radio :label="2">解码</el-radio>
                  <el-radio :label="3">双向</el-radio>
                </el-radio-group>
              </td>
            </tr>
            <tr>
              <td>单位名称</td>
              <td colspan="3">
                <el-input v-model="txtunitname" placeholder="" readonly></el-input>
              </td>
            </tr>
            <tr>
              <td>模块/仪器</td>
              <td>
                <el-input v-model="txtinstrserial" placeholder="" clearable readonly></el-input>
              </td>
              <td>仪器ID</td>
              <td>
                <el-input v-model="txtinstrid" placeholder="" clearable readonly></el-input>
              </td>
            </tr>
            <tr>
              <td vertical-align="top">注册码</td>
              <td colspan="3">
                <div v-if="product == '2'">
                  <el-input type="textarea" v-model="txtinstrsn" placeholder="" :rows="10" style="width:100%"></el-input>
                </div>
                <div v-else>
                  <el-input type="textarea" v-model="txtdualinstrsn" placeholder="" :rows="10"
                    style="width:100%"></el-input>
                </div>
              </td>
            </tr>
          </table>
        </div>
      </div>
      <span slot="footer" class="dialog-footer">
        <el-button @click="register">注 册</el-button>
        <el-button @click="dialogInstrVisible = false">取 消</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import QRCode from "qrcodejs2";
// import { format } from "path";
import XEUtils from "xe-utils";
// import { networkInterfaces } from "os";
export default {
  name: "LIS140",
  data() {
    return {
      creatcodestring: "", //"3:INSTR6$瑞美DEMO医院$SG$10",
      txtsearch: "",
      labgroupval: "",
      seccodeval: "",
      dialogtitle: "",
      product: 2,
      qcproduct: 2,
      instrid: "",
      childinstr: "",
      operatetype: "",
      message: "",
      childmessage: "",
      dialogwidth: "",
      samplestrat: "0",
      sampleend: "Z",
      instorerptunit: "",
      activeName: "instridname",
      txtunitname: "",
      txtinstrserial: "",
      txtinstrid: "",
      txtinstrsn: "",
      txtregisterdate: "",
      txtdualinstrsn: "",
      txtdualregister_dt: "",
      tempindex: 0,
      actionindex: 0, //0查询 1修改 2删除
      loading: false,
      dialogVisible: false,
      DeldialogVisible: false,
      bToChildDlg: false, //临时子模块安装
      dialogInstoreVisible: false, //入库规则弹窗
      dialogQccodeVisible: false, //二维码注册弹窗
      dialogInstrVisible: false, //检验仪器注册弹窗
      isshow: false,
      bHaveChild: false,
      TestInstruments: {},
      popTestInstruments: {},
      oldformdata: {},
      selrow: [],
      tableData1: [],
      tableData2: [],
      temptabledata: [],
      tpChildData: [], //临时子模块数据
      toChildRow: [], //用于安装子模块
      childData: [],
      tempkey: 0,
      disdelflag: false,
      channel_number: [
        { label: "@All 所有通道", value: "1" },
        { label: "", value: "0" },
      ],
      tablePage: {
        pageSize: 15,
      },
      keyConfig: {
        isArrow: true,
        isDel: true,
        isTab: true,
        isEdit: true,
      },
      selectConfig: {
        tigger: "row",
      },
      validRules: {
        rptunitid: [{ required: true, message: "入库报告单元必须填写" }],
      },
      tableProxy: {
        index: true, // 启用动态序号代理
        // 配置响应的数据属性
        props: {
          result: "data.result",
          total: "data.page.total",
        },
        ajax: {
          // page 对象： { pageSize, currentPage }
          query: (param) => {
            let _this = this;
            return new Promise((s, f) => {
              _this.$tool
                .request({
                  url: "LIS/LIS1/LIS140",
                  method: "post",
                  data: {
                    action: "query",
                  },
                })
                .then((res) => {
                  var collist = [
                    {
                      type: "index",
                      title: "NO.",
                      width: 50,
                    },
                  ];
                  for (let i = 0, len = res.Cols.length; i < len; i++) {
                    const item = res.Cols[i];
                    let colitem = {
                      field: item.field,
                      title: item.title,
                      width: item.width,
                      formatter: this.formatdata,
                      sortable: true,
                    };
                    collist.push(colitem);
                  }
                  this.tableColumn = collist;
                  let cData = res.Data;
                  if (this.txtsearch != "") {
                    cData = cData.filter((item) => item.instrid == this.txtsearch || item.instrno.toUpperCase().indexOf(this.txtsearch.toUpperCase()) > -1 || item.instrname.indexOf(this.txtsearch) > -1 || item.instrserial.toUpperCase().indexOf(this.txtsearch.toUpperCase()) > -1);
                  }
                  if (this.labgroupval && this.labgroupval != "") {
                    cData = cData.filter((item) => item.labgroupname == this.labgroupval);
                  }
                  if (this.seccodeval && this.seccodeval != "") {
                    cData = cData.filter((item) => item.instrclass == this.seccodeval);
                  }
                  if (this.childinstr && this.childinstr != "") {
                    cData = cData.filter((item) => item.childinstr == this.childinstr);
                  }

                  if (cData.length > 0) {
                    if (this.actionindex == 0) {
                      //查询
                      this.selrow = cData[0];
                    } else if (this.actionindex == 1) {
                      //修改
                      this.selrow = cData.filter((item) => {
                        return item.instrid == this.instrid;
                      })[0];
                    } else {
                      //删除
                      if (this.tempindex > 0) this.selrow = cData[this.tempindex];
                      else this.selrow = cData[0];
                    }
                  } else {
                    this.selrow = null;
                  }

                  this.$nextTick(() => {
                    if (this.$refs.xTable) {
                      if (this.selrow) {
                        this.$refs.xTable.setCurrentRow(this.selrow);
                        this.currentChangeEventFun(this.selrow);
                      }
                    }
                  });
                  s({
                    data: {
                      page: {
                        total: res.total,
                      },
                      result: cData,
                    },
                  });
                })
                .catch((e) => {
                  console.log("erro", e);
                  f(e);
                });
            });
          },
        },
      },
      tableColumn: [],
    };
  },
  components: {},
  created() { },
  mounted() { },
  updated() { },
  methods: {
    //删除
    btnDeleteTemp() {
      let delrow = this.$refs.tpCXTable.getCurrentRow();
      if (delrow) {
        let msg = "您确定删除临时子模块？";
        if (this.childmessage) msg = "您确定要删除临时子模块：[<b style='color:red'>" + this.childmessage + "]</b>吗？";
        this.$confirm(msg, {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
          dangerouslyUseHTMLString: true,
        })
          .then(() => {
            this.confirmDel(delrow);
          })
          .catch(() => { });
      } else {
        console.log("111");
        this.$alert("请选中需要删除的数据。", "提示");
      }
    },
    async confirmDel() {
      try {
        var delrow = this.$refs.tpCXTable.getCurrentRow();
        if (delrow) {
          var alld = this.$refs.tpCXTable.tableData;
          var rowindex = alld.indexOf(delrow);
          await this.btnDelComfirm(delrow).then(() => {
            this.$refs.tpCXTable.remove(delrow);
            this.tpChildData.splice(rowindex, 1);
            let havedata = this.$refs.tpCXTable.tableData;
            if (havedata.length > 0) {
              if (rowindex >= havedata.length) rowindex = havedata.length - 1;
              let selectrow = havedata[rowindex];
              this.HightLightRow(selectrow);
            } else {
              this.HightLightRow(false);
            }
          });
        }
      } catch (e) {
        this.ErrorCatch(e, "", "error");
      }
    },
    async HightLightRow(row) {
      if (!!row) {
        this.$refs.tpCXTable.setCurrentRow(row);
      } else {
        this.$refs.tpCXTable.setCurrentRow(null);
        this.tpChildData = {};
      }
    },
    async btnDelComfirm(delrow) {
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "deleteTempModule",
            delrow: delrow,
          },
        });
        if (res.errcode == "1") {
          this.$message.success("删除子模块成功！");
        } else {
          this.$message.error(res.errmsg, "删除子模块失败:", "error");
        }
      } catch (e) {
        this.$alert(e, "出错");
      }
    },
    //获取单位名称
    getUnitName() {
      return this.$tool.request({
        url: "LIS/LIS1/LIS140",
        method: "post",
        data: {
          action: "getUnitName",
        },
      });
    },
    labgroupchange(code, name) {
      this.labgroupval = name;
      this.actionindex = 0; //查询
      this.findList();
    },
    seccodechange(code, name) {
      this.seccodeval = name;
      this.findList();
      this.actionindex = 0; //查询
    },
    findList2() {
      this.actionindex = 0; //查询
      this.findList();
    },
    findList() {
      //查询
      this.$refs.xTable.commitProxy("query");
    },
    modifyList() {
      //修改
      var selrow = this.$refs.xTable.getCurrentRow();
      if (selrow) {
        this.ModifyDataQuery();
        this.dialogtitle = "检验仪器修改";
        this.operatetype = "1";
        this.dialogwidth = "50%";
        this.dialogVisible = true;
        this.actionindex = 1;
        this.$nextTick(() => {
          this.$refs.autofocus1.$refs.ddlmainSelect.focus();
        });
      } else {
        this.$message({
          message: "请先选中要修改的数据！",
          type: "error",
        });
      }
    }, //ajax查询要修改数据
    ModifyDataQuery() {
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "queryforupdate",
            instrid: this.instrid,
          },
        })
        .then((res) => {
          let row = res.Data[0];
          this.popTestInstruments = {
            instrid: this.instrid,
            labgroupid: row.labgroupid,
            instrno: row.instrno,
            instrname: row.instrname,
            rptunitid: row.rptunitid,
            instrna: row.instrna,
            install_place: row.install_place,
            inst_useage: row.inst_useage,
            his_code: row.his_code,
            reserve1: row.reserve1,
            reserve2: row.reserve2,
            reserve3: row.reserve3,
            reserve4: row.reserve4,
            reserve5: row.reserve5,
            inuse: row.inuse,
          };
          this.oldformdata = XEUtils.clone(this.popTestInstruments, true);
        })
        .catch((e) => {
          console.log("error", e);
        });
    },
    removeList() {
      //删除
      var delrow = this.$refs.xTable.getCurrentRow();
      if (delrow) {
        this.dialogtitle = "提示";
        this.dialogwidth = "30%";
        this.operatetype = "0";
        this.DeldialogVisible = true;
        this.actionindex = 2;
      } else {
        this.$message({
          message: "请先选中要删除的数据！",
          type: "error",
        });
      }
    },
    SubmitDel() {
      //删除确定
      this.DeldialogVisible = false;
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "del",
            instrid: this.instrid,
            oldinfo: this.TestInstruments,
          },
        })
        .then((res) => {
          if (res.errcode == "1") {
            this.$message({
              message: "删除成功！",
              type: "success",
            });
            this.findList();
            this.instrid = "0";
          } else {
            this.$message({
              message: "删除失败！",
              type: "warning",
            });
          }
        })
        .catch((e) => {
          console.log(e);
        });
    },
    poplabgroupchange(c, v) {
      this.TestInstruments.labgroupid = c;
    },
    poprptunitchange(c, v) {
      this.TestInstruments.rptunitid = c;
    },
    SubmitMod() {
      //修改确定
      let fromdata = {
        instrid: this.instrid,
        labgroupid: this.popTestInstruments.labgroupid, //labgroupid,
        instrno: this.popTestInstruments.instrno,
        instrname: this.popTestInstruments.instrname,
        rptunitid: this.popTestInstruments.rptunitid,
        instrna: this.popTestInstruments.instrna,
        install_place: this.popTestInstruments.install_place,
        inst_useage: this.popTestInstruments.inst_useage,
        his_code: this.popTestInstruments.his_code,
        reserve1: this.popTestInstruments.reserve1,
        reserve2: this.popTestInstruments.reserve2,
        reserve3: this.popTestInstruments.reserve3,
        reserve4: this.popTestInstruments.reserve4,
        reserve5: this.popTestInstruments.reserve5,
        inuse: this.popTestInstruments.inuse,
      };
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "update",
            uptinfo: fromdata,
            oldinfo: this.oldformdata,
          },
        })
        .then((res) => {
          if (res.errcode == "1") {
            this.findList();
            this.$message({
              message: "修改成功！",
              type: "success",
            });
            this.dialogVisible = false;
          } else {
            this.$message({
              message: "修改失败！" + res.errmsg,
              type: "warning",
            });
          }
        })
        .catch((e) => {
          console.log(e);
        });
    },
    currentChangeEventFun(row) {
      this.message = row.instrname;
      this.instrid = row.instrid;
      this.txtinstrid = row.instrid;
      this.txtinstrsn = row.instrsn; //解码注册码
      this.txtregisterdate = row.register_dt; //解码注册时间
      this.txtdualinstrsn = row.dualinstrsn; //双工注册码
      this.txtdualregister_dt = row.dualregister_dt; //双工注册时间
      this.txtinstrserial = row.instrserial;
      // if (row.parentid != "" && row.parentid != null) {
      //     this.bHaveChild = true
      // } else this.bHaveChild = false
      if ((row.instrsn != "" && row.register_dt != "") || (row.dualinstrsn != "" && row.dualregister_dt != "")) {
        this.disdelflag = true;
      } else {
        this.disdelflag = false;
      }
      this.TestInstruments = {
        labgroupid: row.labgroupid,
        labgroupname: row.labgroupname,
        instrid: row.instrid,
        instrno: row.instrno,
        instrname: row.instrname,
        instrserial: row.instrserial,
        instrclass: row.instrclass,
        rptunitid: row.rptunitid,
        rptunitname: row.rptunitname,
        childinstr: row.childinstr,
        childno: row.childno,
        parentname: row.parentname,
        instrna: row.instrna,
        dualmode: row.dualmode,
        macaddress: row.macaddress,
        compute_name: row.compute_name,
        install_dt: XEUtils.toDateString(row.install_dt),
        reinstall_dt: XEUtils.toDateString(row.reinstall_dt),
        compute_ip: row.compute_ip,
        install_place: row.install_place,
        inst_useage: row.inst_useage,
        register_dt: XEUtils.toDateString(row.register_dt),
        inuse: row.inuse,
        stop_dt: XEUtils.toDateString(row.stop_dt),
        his_code: row.his_code,
        open_time: XEUtils.toDateString(row.open_time),
        close_time: XEUtils.toDateString(row.close_time),
        runid: row.runid,
        runcomputer: row.runcomputer,
        runip: row.runip,
        reserve1: row.reserve1,
        reserve2: row.reserve2,
        reserve3: row.reserve3,
        reserve4: row.reserve4,
        reserve5: row.reserve5,
        onlineversion: row.onlineversion,
        decversion: row.decversion,
      };
      if (row.childinstr == "1") {
        this.TestInstruments.childinstr = "是";
      } else {
        this.TestInstruments.childinstr = "否";
      }
      this.queryTempChild();
    },
    currentChangeEvent({ row, $rowIndex }) {
      //行选中
      this.tempindex = $rowIndex;
      this.activeName = "instridname";
      this.currentChangeEventFun(row);
    },
    ExportCsv() {
      //导出
      let options = {
        filename: "LIS140 检验仪器.csv",
      };
      this.$refs.xTable.exportCsv(options);
    },
    //printrecord() {}, //打印
    instorerules() {
      this.getinstritemdest();
      this.getinstritem();
      this.dialogInstoreVisible = true;
    }, //入库规则
    getinstritemdest() {
      //入库规则左侧
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "instritemdest",
            instrid: this.instrid,
          },
        })
        .then((response) => {
          this.tableData1 = response.Data;
        })
        .catch((e) => {
          console.log("error", e);
        });
    },
    getinstritem() {
      //入库规则右
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "instritem",
            instrid: this.instrid,
          },
        })
        .then((response) => {
          this.tableData2 = response.Data;
          let arrchannel = [{ label: "@All 所有通道", value: "@All" }];
          response.Data.forEach((item) => {
            var val = item.interno;
            var lab = item.interno + " " + item.itemcode_en + " " + item.rpt_itemname;
            arrchannel.push({ label: lab, value: val });
          });
          this.channel_number = arrchannel;
        })
        .catch((e) => {
          console.log("error", e);
        });
    },
    saveinstorerules() {
      //入库规则保存
      let tabledata = this.$refs.xTable1.getRecordset();
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "destsave",
            instrid: this.instrid,
            urec: tabledata,
          },
        })
        .then((response) => {
          if (response.errcode == "1") {
            this.$message({
              message: "保存成功！",
              type: "success",
            });
            this.dialogInstoreVisible = false;
          } else {
            this.$message({
              message: "保存失败！" + response.errmsg,
              type: "warning",
            });
          }
        });
    },
    delinstorerules() {
      //入库规则删除
      var delrow = this.$refs.xTable1.getCurrentRow();
      if (delrow) {
        var alld = this.$refs.xTable1.tableData;
        var rowindex = alld.indexOf(delrow);
        this.$refs.xTable1.remove(delrow);
        let havedata = this.$refs.xTable1.tableData;
        if (havedata.length > 0) {
          if (rowindex >= havedata.length) rowindex = havedata.length - 1;
          let selectrow = havedata[rowindex];
          this.$refs.xTable1.setCurrentRow(selectrow);
        }
      } else {
        this.$message({
          message: "请先选中要删除的数据",
          type: "warning",
        });
      }
    },
    refqccode() {
      //二维码注册
      this.getUnitName()
        .then((res) => {
          this.txtunitname = res;
          this.createdcodestr();
        })
        .catch((e) => {
          this.$alert("获取单位名称出错！");
        });
      if (this.txtinstrsn != "" && this.txtregisterdate != "") {
        this.$confirm("当前仪器似乎已经注册，你是否要重新注册？", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            //重新注册
            this.dialogQccodeVisible = true;
          })
          .catch(() => { });
      } else {
        this.dialogQccodeVisible = true;
      }
    },
    qcproductChange() {
      this.createdcodestr();
    },
    createdcodestr() {
      let qcproductstr = "";
      if (this.qcproduct == "2") {
        //解码
        qcproductstr = "CLOUDLIS7I";
      } else if (this.qcproduct == "3") {
        //双向
        qcproductstr = "CLOUDLIS7ID";
      }
      if (this.txtunitname != "") {
        this.creatcodestring = "3:" + qcproductstr + "$" + this.txtunitname + "$" + this.txtinstrserial + "$" + this.txtinstrid;
      }
      this.creatqccode();
    },
    instrRegister() {
      //检验仪器注册
      this.getUnitName().then((res) => {
        this.txtunitname = res;
      });
      if ((this.txtinstrsn != "" && this.txtregisterdate != "") || (this.txtdualinstrsn != "" && this.txtdualregister_dt != "")) {
        //注册过
        this.$confirm("当前仪器似乎已经注册，你是否要重新注册？", "提示", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning",
        })
          .then(() => {
            //重新注册
            // this.getUnitName();
            this.dialogInstrVisible = true;
          })
          .catch(() => { });
      } else {
        //未注册过
        // this.getUnitName();
        this.dialogInstrVisible = true;
      }
    },
    cellClassName({ row, column }) {
      if (column.property == "instrname") {
        if (row.instrsn != "" && row.register_dt != "" && row.dualinstrsn != "" && row.dualregister_dt != "") {
          //解码和双向都注册
          return "stat-1";
        } else if (row.instrsn != "" && row.register_dt != "") {
          //已注册解码
          return "stat-2";
        } else if (row.dualinstrsn != "" && row.dualregister_dt != "") {
          //已注册双向
          return "stat-3";
        } else {
          //未注册
          return "";
        }
      }
    },
    rowClassName({ row, rowIndex }) {
      if (row.inuse == "0") {
        return "rm-alert";
      }
    }, //注册
    register() {
      let oristr = "";
      if (this.product == 2) {
        //解码
        oristr = this.txtunitname + "I" + this.txtinstrid + this.txtinstrserial.toUpperCase();
      } else {
        //双向
        oristr = this.txtunitname + "D" + this.txtinstrid + this.txtinstrserial.toUpperCase();
      }
      this.$tool
        .request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "register",
            oristr: oristr, //源字符串
            instrsn: this.txtinstrsn, //解码注册码
            dualinstrsn: this.txtdualinstrsn, //双工注册码
            product: this.product, //产品
            instrid: this.txtinstrid,
          },
        })
        .then((response) => {
          if (response.errorcode == "1") {
            this.dialogInstrVisible = false;
            this.$message({
              message: "注册成功！",
              type: "success",
            });
            this.$refs.xTable.commitProxy("query");
          } else {
            this.$message({
              message: response.errormsg,
              type: "error",
            });
          }
        });
    },
    rptunitchange(c, v) {
      //工具栏报告单元
      this.instorerptunit = c;
    },
    rptunitchange2(c, row) {
      //表格报告单元
      //this.instorerptunit = c;
      row.rptunitid = c;
    },
    popcurrentChangeEvent({ row }) { },
    poprightdblclick({ row, rowIndex }) {
      let initdata = {
        interno: row.interno,
        startsampleno: this.samplestrat,
        endsampleno: this.sampleend,
        rptunitid: this.instorerptunit,
      };
      this.$refs.xTable1.insert(initdata);
    },
    creatqccode() {
      this.$nextTick(function () {
        this.qrcode(this.creatcodestring);
      });
      // this.qrcode(this.creatcodestring);
    },
    qrcode(a) {
      /* eslint-disable */
      this.$refs.qrcode.innerHTML = "";
      let qrcode = new QRCode("qrcode", {
        width: 200, // 设置宽度，单位像素
        height: 200, // 设置高度，单位像素
        text: a, // 设置二维码内容或跳转地址
      });
    },
    formatdata({ cellValue, row, column }) {
      if (column.property == "inuse") {
        if (row.inuse == 0) {
          return "停用";
        } else {
          return "在用";
        }
      } else if (column.property == "childinstr") {
        if (row.childinstr == "1") {
          return "是";
        } else {
          return "否";
        }
      } else if (column.property == "install_dt" || column.property == "reinstall_dt" || column.property == "register_dt" || column.property == "stop_dt" || column.property == "close_time" || column.property == "open_time") {
        return XEUtils.toDateString(cellValue);
      } else {
        return cellValue;
      }
    },
    Funautofocus(element) {
      if (element == "autofocus1") {
        this.$refs.autofocus1.$refs.ddlmainSelect.blur();
        this.$refs.autofocus2.focus();
      } else if (element == "autofocus2") {
        this.$refs.autofocus3.focus();
      } else if (element == "autofocus3") {
        this.$refs.autofocus4.$refs.ddlrptunitSelect.focus();
      } else if (element == "autofocus4") {
        this.$refs.autofocus4.$refs.ddlrptunitSelect.blur();
        this.$refs.autofocus5.focus();
      } else if (element == "autofocus5") {
        this.$refs.autofocus6.focus();
      } else if (element == "autofocus6") {
        this.$refs.autofocus7.focus();
      } else if (element == "autofocus7") {
        this.$refs.autofocus8.focus();
      } else if (element == "autofocus8") {
        this.$refs.autofocus9.focus();
      } else if (element == "autofocus9") {
        this.$refs.autofocus10.focus();
      } else if (element == "autofocus10") {
        this.$refs.autofocus11.focus();
      } else if (element == "autofocus11") {
        this.$refs.autofocus12.focus();
      } else if (element == "autofocus12") {
        this.$refs.autofocus13.focus();
      } else if (element == "autofocus13") {
        this.$refs.autofocus14.$el.focus();
      } else if (element == "autofocus14") {
        //this.$refs.autofocus1.$refs.ddlmainSelect.focus();
        this.SubmitMod();
      }
    },
    //子模块
    handleClick(tab, event) {
      this.tempkey++;
      if (tab.label == "子模块") {
        this.queryTempChild();
      }
    },
    async queryTempChild() {
      //查询临时子模块
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "querytempchild",
            instrid: this.TestInstruments.instrid,
          },
        });
        if (res.data.length > 0) {
          this.tempkey++;
          this.toChildRow = [];
          this.bHaveChild = true;
          this.tpChildData = res.data;
          //console.log("🥶🥴🧐 —— this.tpChildData", this.tpChildData[0]);
          this.toChildRow = this.tpChildData[0];
          setTimeout(() => {
            // this.$refs.tpCXTable.setCurrentRow(res.data[0]);
            this.childmessage = "父仪器:" + this.tpChildData[0].parentname + ",模块代号:" + this.tpChildData[0].childno;
          }, 80);
        } else {
          this.bHaveChild = false;
          this.tpChildData = [];
          this.toChildRow = [];
        }
      } catch (e) {
        console.log(e);
      }
    },
    ToChild() {
      this.dialogtitle = "提示";
      this.dialogwidth = "30%";
      this.operatetype = "0";
      let row = this.$refs.tpCXTable.getCurrentRow();
      if (row) {
        this.bToChildDlg = true;
      } else this.$alert("请选中需要安装的子模块", "提示");
    },
    async btnChildSave() {
      let row = this.$refs.tpCXTable.getCurrentRow();
      if (!row) {
        this.$alert("请选中需要删除的数据", "提示");
      }
      try {
        const res = await this.$tool.request({
          url: "LIS/LIS1/LIS140",
          method: "post",
          data: {
            action: "addchild",
            parentid: row.parentid,
            childno: row.childno,
            instrserial: row.instrserial,
            create_dt: row.create_dt,
          },
        });
        if (res.errcode == "1") {
          if (this.$refs.tpCXTable.length < 2) {
            this.activeName = "instridname";
          }
          this.actionindex = 1;
          this.$message.success("临时子模块安装成功！");
          this.bToChildDlg = false;
          this.findList();
        } else {
          this.actionindex = 0;
          this.$message({
            message: "临时子模块失败！" + res.errmsg,
            type: "warning",
          });
        }
      } catch (e) {
        this.$alert(e);
      }
    },
    TpChildChange({ row }) {
      this.$refs.tpCXTable.setCurrentRow(row);
      console.log("row", row);
      this.toChildRow = row;
      this.childmessage = "父仪器:" + row.parentname + ",模块代号:" + row.childno;
    },
  },
};
</script>

<style scoped>
.pagetop {
  width: 100%;
  height: 70px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  z-index: 99;
}

.rulepagetop {
  width: 100%;
  height: 35px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  z-index: 999;
}

.popqcpagetop {
  width: 100%;
  height: 105px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
}

.popinstrpagetop {
  width: 100%;
  height: 370px;
  display: -webkit-box;
  -webkit-box-pack: left;
  -webkit-box-align: center;
  border: 1px solid #ccc;
  position: absolute;
  z-index: 999;
}

.pagecenter {
  position: absolute;
  top: 75px;
  width: 100%;
  left: 0;
  bottom: 0px;
}

.rulepagecenter {
  position: absolute;
  top: 40px;
  width: 100%;
  left: 0;
  bottom: 0px;
}

.popqcpagecenter {
  position: absolute;
  top: 110px;
  width: 100%;
  left: 0;
  bottom: 0px;
}

.middle-center {
  position: absolute;
  height: 100%;
  left: 0px;
  right: 615px;
  overflow: hidden;
}

.middle-right {
  position: absolute;
  height: 100%;
  width: 610px;
  right: 0px;
  border: 1px solid #ccc;
  overflow: auto;
}

.popmiddle-center {
  position: absolute;
  height: 100%;
  left: 0px;
  right: 345px;
  overflow: auto;
}

.popmiddle-right {
  position: absolute;
  height: 100%;
  width: 340px;
  right: 0px;
  overflow: auto;
}

.formtablestyle {
  height: 100%;
  font-size: 12px;
  color: #333;
  width: 100%;
}

.formtablestyle tr td {
  padding: 1px;
}

.formtablestyle tr td:nth-child(1),
td:nth-child(3) {
  text-align: right;
}

input[type="text"] {
  box-sizing: border-box;
  text-align: left;
  font-size: 1em;
  height: 2.1em;
  /*border-radius: 4px;*/
  border: 1px solid #c8cccf;
  color: #6a6f77;
  -web-kit-appearance: none;
  -moz-appearance: none;
  display: block;
  outline: 0;
  padding: 0 1em;
  text-decoration: none;
  width: 100%;
}

.search-title {
  margin: 0 5px 0 20px;
  font-size: 12px;
}

input[type="text"]:focus {
  border: 1px solid #ff7496;
}

.table1style tr td {
  padding: 0px 2px 0px 5px;
}

.childtbtopcss {
  height: calc(100% - 25px);
  font-size: 12px;
  /* background-color: #6666ff; */
  width: 100%;
}

::v-deep #tab-childinstrname {
  background: #ffce92;
}

/* .childtbbotcss {
  height: calc(50% - 35px);
  font-size: 12px;
  background-color: #6666ff;
  width: 100%;
} */
::v-deep .middle-right .formtablestyle tr td div .el-input__inner {
  /*border: 1px solid #ffffff !important;*/
  /*background-color: #f4f4f4;*/
}

::v-deep .popmiddle-center tr td div .el-input__inner {
  border: 1px solid rgba(255, 254, 254, 0) !important;
  background-color: rgba(255, 254, 254, 0) !important;
}

::v-deep .REFinuse1 .el-input__inner {
  color: red;
}

::v-deep .REFinuse2 .el-input__inner {
  color: blue;
}

::v-deep .vxe-table .vxe-body--column.stat-1 {
  background-color: #6666ff;
  /*淡褐*/
  color: #f0f8ff;
  /*白*/
}

::v-deep .vxe-table .vxe-body--column.stat-2 {
  background-color: #00cccc;
  /*绿*/
  color: #f0f8ff;
  /*白*/
}

::v-deep .vxe-table .vxe-body--column.stat-3 {
  background-color: #0099ff;
  /*蓝*/
  color: #f0f8ff;
  /*白*/
}

::v-deep .el-button.is-disabled {
  border: 0px;
  color: grey;
  background-color: #e6e6e6;
  font-weight: normal;
}</style>
